chore(docs): upgrade Docosaurus to 3.9.2 with Rspack and SWC optimizations#68600
chore(docs): upgrade Docosaurus to 3.9.2 with Rspack and SWC optimizations#68600letiescanciano merged 5 commits intomasterfrom
Conversation
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. Helpful Resources
PR Slash CommandsAirbyte Maintainers (that's you!) can execute the following slash commands on your PR:
|
| return { | ||
| type: "category", | ||
| label: contentTitle, | ||
| key: `${prefix}${filename}-category`, |
There was a problem hiding this comment.
we need keys for sidebar items to generate unique translations keys
7549f96 to
e7657f0
Compare
|
Deploy preview for airbyte-docs ready! ✅ Preview Built with commit 30bb483. |
There was a problem hiding this comment.
I verified several things.
- Build times are around 5 minutes\ (with 8 cores / 16 GB)
- Mermaid diagrams display.
- API docs display.
- Code samples imported from GitHub display.
- Connectors and migration guides display for AB and Enterprise connectors.
- MarkDown includes between files work correctly.
- Search works (and looks a bit nicer thanks to the new version of Algolia).
- Click around the site and spot checked things.
Could not verify:
- Chameleon survey doesn't open after clicking "no" on the feedback question. That might just be because it only runs on docs.airbyte.com though, probably not an issue.
- I did notice some API pages are "floating" with no sidebar (example), but that seems unrelated to the work here and might be an API-specific problem.
I can find no fault with anything here.
| experimental_faster: { | ||
| rspackBundler: true, | ||
| rspackPersistentCache: true, | ||
| swcJsMinimizer: true, | ||
| swcJsLoader: true, | ||
| }, |
There was a problem hiding this comment.
Doesn't experimental_faster: true, enable all the speed improvements already?
There was a problem hiding this comment.
I thought it did but it turns out it only selects a few, according to Claude. I need to still find the docs, but I also thought it was more descriptive outlining what we wanted to enable
There was a problem hiding this comment.
The only thing I've found in the docs it's that it should enable all of them. facebook/docusaurus#10931
but if I use experimental_faster:true I get this error:
[ERROR] Site reload failure
Error: Docusaurus config `future.experimental_faster.ssgWorkerThreads`
requires the future flag `future.v4.removeLegacyPostBuildHeadAttribute` to be turned on.
so I'll add the ones I was missing, and don't use ssgWorkerThreads until we want to enable v4 flags
ceff83f to
9789ceb
Compare
Reorganize connector registry management for better separation of concerns: Build-time improvements: - Create fetch-registry.js: Centralized utility for fetching and caching registry - Handles cache check, network fetch fallback, and minimal data extraction - Reusable by all build scripts without duplication - Reduced console logging for cleaner build output - Rename prepare-sidebar-data.js to prepare-registry-cache.js - More accurately reflects its purpose as a registry cache preparer - Updated package.json scripts to use new name - Consolidate constants into src/scripts/constants.js - Centralized registry paths, URLs, and doc directory constants - Used by all scripts: fetch-registry, prepare-registry-cache, cleanup-cache - Simplify connector_registry.js to original approach (network fetch only) - No complex caching logic (handled by fetch-registry now) - Maintains original compatibility with remark plugins Client-side improvements: - Create clientRegistryUtils.js: Browser-safe registry lookup - Uses fetch to retrieve registry at runtime - Separated from build-time utilities to prevent webpack bundling issues - Update RequestERD and EntityRelationshipDiagram components - Use clientRegistryUtils instead of build-time registry - Components now self-contained and independent of build process Webpack fixes: - No longer attempt to bundle Node.js code (fs, path modules) - Remark plugins now use fetch-registry (async, build-time only) - Client components use clientRegistryUtils (browser-safe) Benefits: ✓ Clean separation: Build-time vs Runtime vs Client-side code ✓ Single responsibility: Each script has one clear purpose ✓ DRY principle: No duplicate constants or logic ✓ Reduced logging: Cleaner build output ✓ Better maintainability: Easier to understand data flow
Summary
Upgrade Docosaurus from 3.7.0 to 3.9.2 with major performance improvements:
Changes
swcJsMinimizer, swcJsLoader)
Expected Improvements
Build time on Vercel (4 cores, 8GB):
Testing
Can this PR be safely reverted and rolled back?